[Apache Camel] Generating multiple files based on DB query in a nice way

Posted by chantingwolf on Stack Overflow See other posts from Stack Overflow or by chantingwolf
Published on 2010-04-24T17:36:48Z Indexed on 2010/04/24 17:43 UTC
Read the original article Hit count: 374

Filed under:

Dear all,

I have a following question. I have to generate many files based on sql query.

Let's say for example, I have get from database a list of orders made today and genarate file for each order and later store each file on ftp.

Ideally I would like to get follewing. Not quite sure how to get it.

from(MyBean).to(Ftp)

The problem and main question is how to generate multiple messages by custom bean (for example).

I am not sure if splitter EIP is ok in this case because in my case I have not just one message to split, but I just have to generate and send many messages. http://camel.apache.org/splitter.html

I hope, someone meet this problem before.

If the task will be to generate just one file - everything is quite simple - you need just fill Exchange.OutMessage (or something like this). But what about multiple files - I really can't get, how to manage this situation.

P.S. Sorry if this question is stupid. I am novice in Camel (working with it just for coupe weeks). It's a great tool. Actually, that's why I want to use in in the best way.

Thanks a lot.

© Stack Overflow or respective owner

Related posts about apache-camel